/*
 Navicat Premium Dump SQL

 Source Server         : 本地
 Source Server Type    : MySQL
 Source Server Version : 90001 (9.0.1)
 Source Host           : localhost:3306
 Source Schema         : inventory_system1

 Target Server Type    : MySQL
 Target Server Version : 90001 (9.0.1)
 File Encoding         : 65001

 Date: 30/07/2025 18:05:18
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for fc_class
-- ----------------------------
DROP TABLE IF EXISTS `fc_class`;
CREATE TABLE `fc_class` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `created_at` datetime(3) DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime(3) DEFAULT NULL COMMENT '修改时间',
  `cid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '班级ID',
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '班级名称',
  `location` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '班级位置',
  `exam_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '考试类型',
  `instructor` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '讲师',
  `comment` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '备注',
  `is_deleted` bigint DEFAULT '0' COMMENT '是否删除 1已删除,0未删除',
  `type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '类型 笔试/面试',
  `status` int NOT NULL COMMENT '开课状态 1开课中,2停课,3待开课,4结课',
  `course_start_date` date DEFAULT NULL COMMENT '开课时间',
  `course_end_date` date DEFAULT NULL COMMENT '结课时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uni_fc_class_cid` (`cid`),
  KEY `idx_fc_classes_cid` (`cid`),
  KEY `idx_fc_class_cid` (`cid`)
) ENGINE=InnoDB AUTO_INCREMENT=317 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='班级表';

-- ----------------------------
-- Records of fc_class
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for fc_class_fee_data
-- ----------------------------
DROP TABLE IF EXISTS `fc_class_fee_data`;
CREATE TABLE `fc_class_fee_data` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `created_at` datetime(3) DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime(3) DEFAULT NULL COMMENT '修改时间',
  `date` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '日期',
  `class` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '班级ID',
  `class_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '班级名称',
  `class_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '班级类型',
  `class_exam_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '考试类型',
  `goods_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '费用分类ID',
  `goods_type_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '费用分类名称',
  `goods_type_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '费用分类编码',
  `total_value` decimal(30,15) DEFAULT NULL COMMENT '金额合计',
  `total_people_num` int DEFAULT NULL COMMENT '总服务人次',
  PRIMARY KEY (`id`),
  KEY `idx_fc_class_fee_data_class_type` (`class_type`),
  KEY `idx_fc_class_fee_data_class_exam_type` (`class_exam_type`),
  KEY `idx_fc_class_fee_data_date` (`date`)
) ENGINE=InnoDB AUTO_INCREMENT=281568 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='生成统计数据表';

-- ----------------------------
-- Records of fc_class_fee_data
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for fc_class_schedule
-- ----------------------------
DROP TABLE IF EXISTS `fc_class_schedule`;
CREATE TABLE `fc_class_schedule` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `created_at` datetime(3) DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime(3) DEFAULT NULL COMMENT '修改时间',
  `csid` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '班级上课ID',
  `date` date DEFAULT NULL COMMENT '上课日期',
  `class` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '班级ID',
  `class_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '班级名称',
  `student_count` int DEFAULT NULL COMMENT '学生人数',
  `class_rooms` json DEFAULT NULL COMMENT '占用教室(支持多个)',
  `comment` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '备注',
  `is_deleted` int DEFAULT '0' COMMENT '是否删除 1已删除,0未删除',
  `seq` int DEFAULT '0' COMMENT '排序',
  `total_price` decimal(10,2) DEFAULT NULL COMMENT '总金额',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uni_fc_class_schedule_csid` (`csid`),
  KEY `idx_fc_class_schedule_date` (`date`),
  KEY `idx_fc_class_schedule_class` (`class`)
) ENGINE=InnoDB AUTO_INCREMENT=2173 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of fc_class_schedule
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for fc_department
-- ----------------------------
DROP TABLE IF EXISTS `fc_department`;
CREATE TABLE `fc_department` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `created_at` datetime(3) DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime(3) DEFAULT NULL COMMENT '修改时间',
  `did` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '部门ID',
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '部门名称',
  `pdid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '部门父ID',
  `ancestors` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '父ID列表',
  `full_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '部门名称全路径',
  `comment` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '备注',
  `is_deleted` bigint DEFAULT '0' COMMENT '是否删除 1已删除,0未删除',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uni_fc_department_did` (`did`),
  KEY `idx_fc_department_did` (`did`),
  KEY `idx_fc_department_pdid` (`pdid`)
) ENGINE=InnoDB AUTO_INCREMENT=38 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='部门表';

-- ----------------------------
-- Records of fc_department
-- ----------------------------
BEGIN;
INSERT INTO `fc_department` (`id`, `created_at`, `updated_at`, `did`, `name`, `pdid`, `ancestors`, `full_path`, `comment`, `is_deleted`) VALUES (37, '2025-07-10 21:47:22.581', '2025-07-10 21:47:22.581', '_default_', '未知', '', '', '', '', 0);
COMMIT;

-- ----------------------------
-- Table structure for fc_department_fee_data
-- ----------------------------
DROP TABLE IF EXISTS `fc_department_fee_data`;
CREATE TABLE `fc_department_fee_data` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `created_at` datetime(3) DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime(3) DEFAULT NULL COMMENT '修改时间',
  `date` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '日期',
  `department` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '部门ID',
  `department_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '部门名称',
  `activity` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '活动名称',
  `goods_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '费用分类ID',
  `goods_type_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '费用分类名称',
  `goods_type_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '费用分类编码',
  `total_value` decimal(30,15) DEFAULT '0.000000000000000' COMMENT '金额合计',
  PRIMARY KEY (`id`),
  KEY `idx_department_fee_data_date` (`date`),
  KEY `idx_department_fee_data_department` (`department`)
) ENGINE=InnoDB AUTO_INCREMENT=4869 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='部门费用数据表';

-- ----------------------------
-- Records of fc_department_fee_data
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for fc_exam_type
-- ----------------------------
DROP TABLE IF EXISTS `fc_exam_type`;
CREATE TABLE `fc_exam_type` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '名称',
  `s_id` int DEFAULT NULL COMMENT 'sid',
  PRIMARY KEY (`id`),
  KEY `idx_fc_exam_type_id` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='考试类型表';

-- ----------------------------
-- Records of fc_exam_type
-- ----------------------------
BEGIN;
INSERT INTO `fc_exam_type` (`id`, `name`, `s_id`) VALUES (1, '公考', 0);
INSERT INTO `fc_exam_type` (`id`, `name`, `s_id`) VALUES (2, '医考', 0);
INSERT INTO `fc_exam_type` (`id`, `name`, `s_id`) VALUES (3, '教招', 0);
INSERT INTO `fc_exam_type` (`id`, `name`, `s_id`) VALUES (5, '公安', 0);
INSERT INTO `fc_exam_type` (`id`, `name`, `s_id`) VALUES (6, '事业单位', 0);
INSERT INTO `fc_exam_type` (`id`, `name`, `s_id`) VALUES (7, '银行', 0);
INSERT INTO `fc_exam_type` (`id`, `name`, `s_id`) VALUES (8, '电网', 0);
INSERT INTO `fc_exam_type` (`id`, `name`, `s_id`) VALUES (9, '西部计划/三支一扶/社区民生', 0);
INSERT INTO `fc_exam_type` (`id`, `name`, `s_id`) VALUES (10, '事业单位+教师', 615);
INSERT INTO `fc_exam_type` (`id`, `name`, `s_id`) VALUES (11, '专升本', 0);
INSERT INTO `fc_exam_type` (`id`, `name`, `s_id`) VALUES (12, '国/省考', 0);
INSERT INTO `fc_exam_type` (`id`, `name`, `s_id`) VALUES (13, '省考', 0);
INSERT INTO `fc_exam_type` (`id`, `name`, `s_id`) VALUES (14, '国考', 0);
INSERT INTO `fc_exam_type` (`id`, `name`, `s_id`) VALUES (15, '军队文职', 0);
INSERT INTO `fc_exam_type` (`id`, `name`, `s_id`) VALUES (16, '烟草', 0);
INSERT INTO `fc_exam_type` (`id`, `name`, `s_id`) VALUES (17, '遴选', 0);
INSERT INTO `fc_exam_type` (`id`, `name`, `s_id`) VALUES (18, '退伍军人', 0);
INSERT INTO `fc_exam_type` (`id`, `name`, `s_id`) VALUES (19, '人才引进', 0);
INSERT INTO `fc_exam_type` (`id`, `name`, `s_id`) VALUES (20, '国家能源', 0);
INSERT INTO `fc_exam_type` (`id`, `name`, `s_id`) VALUES (21, '长期协议', 0);
INSERT INTO `fc_exam_type` (`id`, `name`, `s_id`) VALUES (22, '一对一面试', 0);
INSERT INTO `fc_exam_type` (`id`, `name`, `s_id`) VALUES (23, '蒙授', 0);
INSERT INTO `fc_exam_type` (`id`, `name`, `s_id`) VALUES (24, '省考/事业单位', 0);
COMMIT;

-- ----------------------------
-- Table structure for fc_goods
-- ----------------------------
DROP TABLE IF EXISTS `fc_goods`;
CREATE TABLE `fc_goods` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `created_at` datetime(3) DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime(3) DEFAULT NULL COMMENT '修改时间',
  `gid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '货品ID',
  `goods_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '货品编码',
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '货品名称',
  `goods_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '货品类型',
  `unit` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '单位',
  `spec` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '规格',
  `images` json DEFAULT NULL COMMENT '图片',
  `files` json DEFAULT NULL COMMENT '文件',
  `unit_price` decimal(25,15) DEFAULT '0.000000000000000' COMMENT '单价',
  `supplier` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '供应商ID',
  `wx_display` int DEFAULT '0' COMMENT '微信显示 0否,1是',
  `desc` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '描述',
  `is_deleted` bigint DEFAULT '0' COMMENT '是否删除 1已删除,0未删除',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uni_fc_goods_gid` (`gid`),
  KEY `idx_fc_goods_gid` (`gid`)
) ENGINE=InnoDB AUTO_INCREMENT=212 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='货品表';

-- ----------------------------
-- Records of fc_goods
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for fc_goods_type
-- ----------------------------
DROP TABLE IF EXISTS `fc_goods_type`;
CREATE TABLE `fc_goods_type` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `created_at` datetime(3) DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime(3) DEFAULT NULL COMMENT '修改时间',
  `gtid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '货品类型ID',
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '类型名称',
  `type_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '类型编码',
  `is_deleted` bigint DEFAULT '0' COMMENT '是否删除 1已删除,0未删除',
  `is_system_type` bigint DEFAULT '0' COMMENT '类型 1系统类型,0用户自定义类型',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uni_fc_goods_type_gtid` (`gtid`),
  KEY `idx_fc_goods_type_gtid` (`gtid`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='货品类型表';

-- ----------------------------
-- Records of fc_goods_type
-- ----------------------------
BEGIN;
INSERT INTO `fc_goods_type` (`id`, `created_at`, `updated_at`, `gtid`, `name`, `type_code`, `is_deleted`, `is_system_type`) VALUES (10, '2025-03-10 10:36:08.973', '2025-03-10 10:36:08.973', 'gt00000001', '早间膳食', 'zj_food', 0, 1);
INSERT INTO `fc_goods_type` (`id`, `created_at`, `updated_at`, `gtid`, `name`, `type_code`, `is_deleted`, `is_system_type`) VALUES (11, '2025-03-10 10:36:08.986', '2025-03-10 10:36:08.986', 'gt00000002', '晚间膳食', 'wj_food', 0, 1);
INSERT INTO `fc_goods_type` (`id`, `created_at`, `updated_at`, `gtid`, `name`, `type_code`, `is_deleted`, `is_system_type`) VALUES (12, '2025-03-10 10:36:08.991', '2025-03-10 10:36:08.991', 'gt00000003', '其他膳食', 'other_food', 0, 1);
INSERT INTO `fc_goods_type` (`id`, `created_at`, `updated_at`, `gtid`, `name`, `type_code`, `is_deleted`, `is_system_type`) VALUES (13, '2025-03-10 10:36:08.995', '2025-03-10 10:36:08.995', 'gt00000004', '水果', 'sg_food', 0, 1);
INSERT INTO `fc_goods_type` (`id`, `created_at`, `updated_at`, `gtid`, `name`, `type_code`, `is_deleted`, `is_system_type`) VALUES (14, '2025-03-10 10:36:08.002', '2025-03-10 10:36:08.002', 'gt00000005', '物料', 'iktas', 0, 1);
COMMIT;

-- ----------------------------
-- Table structure for fc_inquiry
-- ----------------------------
DROP TABLE IF EXISTS `fc_inquiry`;
CREATE TABLE `fc_inquiry` (
  `id` int NOT NULL AUTO_INCREMENT,
  `inquiry_no` varchar(50) NOT NULL COMMENT '询价单号',
  `goods_name` varchar(200) NOT NULL COMMENT '物品名称',
  `goods_code` varchar(100) DEFAULT NULL COMMENT '物品编号',
  `goods_type` varchar(255) DEFAULT NULL COMMENT '货品类型',
  `unit` varchar(255) NOT NULL COMMENT '单位',
  `spec` varchar(255) DEFAULT NULL COMMENT '规格',
  `inquiry_date` date NOT NULL COMMENT '询价日期',
  `goods_url` varchar(100) DEFAULT NULL COMMENT '物品图片路径',
  `is_tax_included` int DEFAULT '1' COMMENT '是否包含税运 1=包含税运 2=不包含税运',
  `is_use` int DEFAULT '1' COMMENT '是否采用讯价 0=未采用 1=已采用',
  `dimensions` varchar(200) DEFAULT NULL COMMENT '物品尺寸',
  `sample_fee_amount` decimal(10,2) DEFAULT NULL COMMENT '打样费用',
  `supplier_id` int DEFAULT NULL COMMENT '供应商ID',
  `supplier_name` varchar(200) NOT NULL COMMENT '供应商名称',
  `quantity` decimal(10,2) NOT NULL COMMENT '询价数量',
  `unit_price` decimal(10,2) NOT NULL COMMENT '询价单价',
  `total_price` decimal(10,2) NOT NULL COMMENT '总价',
  `remark` text COMMENT '备注',
  `creator` varchar(100) NOT NULL COMMENT '创建人',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `idx_goods_name` (`goods_name`),
  KEY `idx_supplier_name` (`supplier_name`),
  KEY `idx_inquiry_date` (`inquiry_date`),
  KEY `idx_creator` (`creator`)
) ENGINE=InnoDB AUTO_INCREMENT=52 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='询价表';

-- ----------------------------
-- Records of fc_inquiry
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for fc_inventory
-- ----------------------------
DROP TABLE IF EXISTS `fc_inventory`;
CREATE TABLE `fc_inventory` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `created_at` datetime(3) DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime(3) DEFAULT NULL COMMENT '修改时间',
  `iid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '出入库ID',
  `number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '单号批次号',
  `date` date DEFAULT NULL COMMENT '出入库日期',
  `warehouse` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '仓库',
  `inventory_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '出入库类型',
  `department` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '部门',
  `activity` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '活动名称',
  `operator` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '操作员',
  `comment` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '备注',
  `class` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '班级ID',
  `class_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '班级名称',
  `receiver` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '领取人',
  `people_num` int DEFAULT NULL COMMENT '人数',
  `time_period` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '单据时间段（上午/下午）',
  `is_deleted` bigint DEFAULT '0' COMMENT '是否删除 1已删除,0未删除',
  `status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'completed' COMMENT '状态：draft(草稿)/pending(待出库)/completed(已完成)/cancelled(已取消)',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uni_fc_inventory_iid` (`iid`),
  KEY `idx_fc_inventory_iid` (`iid`),
  KEY `idx_fc_inventory_number` (`number`),
  KEY `idx_fc_inventory_warehouse` (`warehouse`)
) ENGINE=InnoDB AUTO_INCREMENT=3974 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='出入库单据表';

-- ----------------------------
-- Records of fc_inventory
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for fc_inventory_detail
-- ----------------------------
DROP TABLE IF EXISTS `fc_inventory_detail`;
CREATE TABLE `fc_inventory_detail` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `created_at` datetime(3) DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime(3) DEFAULT NULL COMMENT '修改时间',
  `idid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '出入库单明细表ID',
  `inventory` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '出入库主表单据号',
  `inventory_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '出入库类型',
  `goods` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '货品ID',
  `amount` decimal(10,2) DEFAULT NULL COMMENT '货品数量',
  `rate` double DEFAULT NULL COMMENT '倍率',
  `comment` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '备注',
  `is_deleted` bigint DEFAULT '0' COMMENT '是否删除 1已删除,0未删除',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uni_fc_inventory_detail_idid` (`idid`),
  KEY `idx_fc_inventory_detail_inventory` (`inventory`),
  KEY `idx_fc_inventory_detail_idid` (`idid`)
) ENGINE=InnoDB AUTO_INCREMENT=9288 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='出入库明细表';

-- ----------------------------
-- Records of fc_inventory_detail
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for fc_inventory_detail_lots
-- ----------------------------
DROP TABLE IF EXISTS `fc_inventory_detail_lots`;
CREATE TABLE `fc_inventory_detail_lots` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `created_at` datetime(3) DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime(3) DEFAULT NULL COMMENT '修改时间',
  `inventory` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '出入库主表单据号',
  `inventory_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '出入库类型',
  `idid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '出入库单明细表ID',
  `goods` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '货品ID',
  `amount` decimal(10,2) DEFAULT NULL COMMENT '货品数量',
  `is_deleted` bigint DEFAULT '0' COMMENT '是否删除 1已删除,0未删除',
  `stock_batch_id` bigint unsigned DEFAULT NULL COMMENT '批次库存ID',
  PRIMARY KEY (`id`),
  KEY `idx_fc_inventory_detail_lots_inventory` (`inventory`),
  KEY `idx_fc_inventory_detail_lots_idid` (`idid`),
  KEY `idx_fc_inventory_detail_lots_stock_batch_id` (`stock_batch_id`)
) ENGINE=InnoDB AUTO_INCREMENT=13075 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='出入库明细表';

-- ----------------------------
-- Records of fc_inventory_detail_lots
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for fc_inventory_order_relation
-- ----------------------------
DROP TABLE IF EXISTS `fc_inventory_order_relation`;
CREATE TABLE `fc_inventory_order_relation` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime DEFAULT NULL COMMENT '更新时间',
  `inventory` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '出入库ID',
  `order` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '订单ID',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uq_order` (`order`)
) ENGINE=InnoDB AUTO_INCREMENT=52 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='出入库订单关联表';

-- ----------------------------
-- Records of fc_inventory_order_relation
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for fc_inventory_type
-- ----------------------------
DROP TABLE IF EXISTS `fc_inventory_type`;
CREATE TABLE `fc_inventory_type` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `created_at` datetime(3) DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime(3) DEFAULT NULL COMMENT '修改时间',
  `itid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '出入库类型ID',
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '出入库类型名称',
  `type` bigint DEFAULT '1' COMMENT '类型 1入库,2出库',
  `type_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '出入库类型编号',
  `is_system_type` bigint DEFAULT '0' COMMENT '类型 1系统类型,0用户自定义类型',
  `is_deleted` bigint DEFAULT '0' COMMENT '是否删除 1已删除,0未删除',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uni_fc_inventory_type_itid` (`itid`),
  KEY `idx_fc_inventory_type_itid` (`itid`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='出入库类型表';

-- ----------------------------
-- Records of fc_inventory_type
-- ----------------------------
BEGIN;
INSERT INTO `fc_inventory_type` (`id`, `created_at`, `updated_at`, `itid`, `name`, `type`, `type_code`, `is_system_type`, `is_deleted`) VALUES (1, '2025-03-05 22:52:35.551', '2025-03-05 22:52:35.551', '1', '入库', 1, 'default_in', 1, 0);
INSERT INTO `fc_inventory_type` (`id`, `created_at`, `updated_at`, `itid`, `name`, `type`, `type_code`, `is_system_type`, `is_deleted`) VALUES (2, '2025-03-05 22:52:35.555', '2025-03-05 22:52:35.555', '2', '出库', 2, 'default_out', 1, 0);
INSERT INTO `fc_inventory_type` (`id`, `created_at`, `updated_at`, `itid`, `name`, `type`, `type_code`, `is_system_type`, `is_deleted`) VALUES (3, '2025-03-17 12:05:51.199', '2025-03-17 12:05:51.199', '3', '退货', 3, 'default_out-return', 1, 0);
INSERT INTO `fc_inventory_type` (`id`, `created_at`, `updated_at`, `itid`, `name`, `type`, `type_code`, `is_system_type`, `is_deleted`) VALUES (4, '2025-03-17 16:20:25.518', '2025-03-17 16:20:25.518', '4', '归还', 4, 'default_out-restore', 1, 0);
INSERT INTO `fc_inventory_type` (`id`, `created_at`, `updated_at`, `itid`, `name`, `type`, `type_code`, `is_system_type`, `is_deleted`) VALUES (5, '2025-03-21 10:41:14.645', '2025-03-21 10:41:14.645', '5', '折损', 5, 'default_out-losss', 1, 0);
COMMIT;

-- ----------------------------
-- Table structure for fc_op_log
-- ----------------------------
DROP TABLE IF EXISTS `fc_op_log`;
CREATE TABLE `fc_op_log` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `created_at` datetime(3) DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime(3) DEFAULT NULL COMMENT '修改时间',
  `uid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '操作日志ID',
  `resource` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '资源',
  `operation` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '操作',
  `status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '状态',
  `request_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '请求ID',
  `path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '路径',
  `body` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT '原始请求体数据',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7682 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='操作日志表';

-- ----------------------------
-- Records of fc_op_log
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for fc_order
-- ----------------------------
DROP TABLE IF EXISTS `fc_order`;
CREATE TABLE `fc_order` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime DEFAULT NULL COMMENT '修改时间',
  `oid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '订单ID',
  `wx_user` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '微信用户ID',
  `number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '订单号',
  `date` date DEFAULT NULL COMMENT '订单日期',
  `warehouse` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '仓库ID',
  `status` int DEFAULT '0' COMMENT '订单状态 0待确认 1已确认 2已完成 3已取消',
  `operator` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '操作员',
  `department` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '部门ID',
  `activity` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '活动名称',
  `class` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '班级ID',
  `comment` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '备注',
  `is_deleted` int DEFAULT '0' COMMENT '是否删除 1已删除,0未删除',
  PRIMARY KEY (`id`),
  KEY `idx_oid` (`oid`)
) ENGINE=InnoDB AUTO_INCREMENT=62 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='订单表';

-- ----------------------------
-- Records of fc_order
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for fc_order_detail
-- ----------------------------
DROP TABLE IF EXISTS `fc_order_detail`;
CREATE TABLE `fc_order_detail` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime DEFAULT NULL COMMENT '修改时间',
  `odid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '订单明细ID',
  `order` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '订单ID',
  `goods` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '货品ID',
  `amount` decimal(10,2) DEFAULT NULL COMMENT '数量',
  `is_deleted` int DEFAULT '0' COMMENT '是否删除 1已删除,0未删除',
  PRIMARY KEY (`id`),
  KEY `idx_order` (`order`)
) ENGINE=InnoDB AUTO_INCREMENT=187 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='订单明细表';

-- ----------------------------
-- Records of fc_order_detail
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for fc_purchase
-- ----------------------------
DROP TABLE IF EXISTS `fc_purchase`;
CREATE TABLE `fc_purchase` (
  `id` int NOT NULL AUTO_INCREMENT,
  `purchase_no` varchar(50) NOT NULL COMMENT '采购单号',
  `submit_time` datetime NOT NULL COMMENT '提交时间',
  `goods_name` varchar(200) NOT NULL COMMENT '物品名称',
  `unit_price` decimal(10,2) NOT NULL COMMENT '单价',
  `quantity` decimal(10,2) NOT NULL COMMENT '数量',
  `total_amount` decimal(10,2) NOT NULL COMMENT '合计金额',
  `payment_method` varchar(50) NOT NULL COMMENT '打款方式',
  `is_repaid` int DEFAULT NULL COMMENT '是否归还  1=未归还 2=已归还',
  `contract_path` varchar(100) DEFAULT NULL COMMENT '合同路径',
  `supplier_name` varchar(200) NOT NULL COMMENT '购买公司',
  `cost_department` varchar(200) NOT NULL COMMENT '费用所属',
  `purchaser` varchar(100) NOT NULL COMMENT '采购人',
  `audit_status` varchar(20) DEFAULT 'pending' COMMENT '审核状态(pending/approved/rejected)',
  `auditor` varchar(100) DEFAULT NULL COMMENT '审核人',
  `audit_time` datetime DEFAULT NULL COMMENT '审核时间',
  `creator` varchar(100) DEFAULT NULL COMMENT '创建人',
  `remark` text COMMENT '备注',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `purchase_no` (`purchase_no`),
  KEY `idx_purchase_no` (`purchase_no`),
  KEY `idx_submit_time` (`submit_time`),
  KEY `idx_goods_name` (`goods_name`),
  KEY `idx_supplier_name` (`supplier_name`),
  KEY `idx_purchaser` (`purchaser`),
  KEY `idx_audit_status` (`audit_status`)
) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='采购表';

-- ----------------------------
-- Records of fc_purchase
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for fc_sms_message
-- ----------------------------
DROP TABLE IF EXISTS `fc_sms_message`;
CREATE TABLE `fc_sms_message` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `created_at` datetime(3) DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime(3) DEFAULT NULL COMMENT '修改时间',
  `classroom_id` bigint unsigned DEFAULT NULL COMMENT '教室ID',
  `hash` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '哈希',
  `data_id` bigint unsigned DEFAULT NULL COMMENT '数据ID',
  `msg_id` bigint unsigned DEFAULT NULL COMMENT '消息ID',
  `phone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '手机号',
  `content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '消息内容',
  `receive_time` datetime DEFAULT NULL COMMENT '接收时间',
  `status` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '回执状态，DELIVRD成功，其他失败',
  `is_deleted` tinyint NOT NULL DEFAULT '0' COMMENT '是否删除 1时/0否',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='短信消息表';

-- ----------------------------
-- Records of fc_sms_message
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for fc_sms_template
-- ----------------------------
DROP TABLE IF EXISTS `fc_sms_template`;
CREATE TABLE `fc_sms_template` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `created_at` datetime(3) DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime(3) DEFAULT NULL COMMENT '修改时间',
  `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '模板标题',
  `code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '模板编码',
  `content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '模板内容',
  `type` tinyint DEFAULT NULL COMMENT '模板类型（1验证码/2通知/3营销）',
  `status` tinyint NOT NULL DEFAULT '1' COMMENT '状态(0=禁用,1=启用),',
  `sign` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '短信签名',
  `desc` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT '模板描述',
  `is_deleted` tinyint NOT NULL DEFAULT '0' COMMENT '是否删除 1时/0否',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='短信模板表';

-- ----------------------------
-- Records of fc_sms_template
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for fc_staff
-- ----------------------------
DROP TABLE IF EXISTS `fc_staff`;
CREATE TABLE `fc_staff` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `created_at` datetime(3) DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime(3) DEFAULT NULL COMMENT '修改时间',
  `sid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '员工ID',
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '员工姓名',
  `department` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '部门',
  `phone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '手机号',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uni_fc_staff_sid` (`sid`),
  KEY `idx_fc_staff_sid` (`sid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='员工表';

-- ----------------------------
-- Records of fc_staff
-- ----------------------------
BEGIN;
INSERT INTO `fc_staff` (`id`, `created_at`, `updated_at`, `sid`, `name`, `department`, `phone`) VALUES (2, '2025-07-10 21:47:22.583', '2025-07-10 21:47:22.583', '_default_', '管理员', '_default_', '');
COMMIT;

-- ----------------------------
-- Table structure for fc_stats_opt_log
-- ----------------------------
DROP TABLE IF EXISTS `fc_stats_opt_log`;
CREATE TABLE `fc_stats_opt_log` (
  `id` int NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `created_at` datetime(3) NOT NULL COMMENT '创建时间',
  `user_id` int NOT NULL COMMENT '操作日志ID',
  `resource` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '资源',
  `path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '路径',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=207 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='数据统计操作日志表';

-- ----------------------------
-- Records of fc_stats_opt_log
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for fc_stats_user
-- ----------------------------
DROP TABLE IF EXISTS `fc_stats_user`;
CREATE TABLE `fc_stats_user` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='统计分析登陆手机号';

-- ----------------------------
-- Records of fc_stats_user
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for fc_stock
-- ----------------------------
DROP TABLE IF EXISTS `fc_stock`;
CREATE TABLE `fc_stock` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `created_at` datetime(3) DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime(3) DEFAULT NULL COMMENT '修改时间',
  `goods` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '货品',
  `warehouse` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '仓库',
  `total_quantity` decimal(10,2) DEFAULT NULL COMMENT '数量',
  `version` int DEFAULT '1' COMMENT '版本号',
  `is_deleted` bigint DEFAULT '0' COMMENT '是否删除 1已删除,0未删除',
  PRIMARY KEY (`id`),
  KEY `idx_fc_stock_warehouse` (`warehouse`)
) ENGINE=InnoDB AUTO_INCREMENT=213 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of fc_stock
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for fc_stock_batch
-- ----------------------------
DROP TABLE IF EXISTS `fc_stock_batch`;
CREATE TABLE `fc_stock_batch` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `created_at` datetime(3) DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime(3) DEFAULT NULL COMMENT '修改时间',
  `stock_id` bigint unsigned DEFAULT NULL COMMENT '总库存ID',
  `batch_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '批次号',
  `goods` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '货品',
  `warehouse` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '仓库',
  `quantity` decimal(10,2) DEFAULT NULL COMMENT '数量',
  `unit_price` decimal(20,15) DEFAULT NULL COMMENT '单价',
  `supplier` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '供应商ID',
  `version` int DEFAULT '1' COMMENT '版本号',
  `is_deleted` bigint DEFAULT '0' COMMENT '是否删除 1已删除,0未删除',
  PRIMARY KEY (`id`),
  KEY `idx_fc_stock_batch_batch_number` (`batch_number`),
  KEY `idx_fc_stock_batch_warehouse` (`warehouse`)
) ENGINE=InnoDB AUTO_INCREMENT=812 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of fc_stock_batch
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for fc_stock_batch_log
-- ----------------------------
DROP TABLE IF EXISTS `fc_stock_batch_log`;
CREATE TABLE `fc_stock_batch_log` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `stock_batch_id` bigint unsigned DEFAULT NULL COMMENT '库存批次ID',
  `goods` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '货品',
  `warehouse` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '仓库',
  `change_type` tinyint DEFAULT NULL COMMENT '类型（1=入库，2=出库）',
  `change_quantity` decimal(10,2) DEFAULT NULL COMMENT '变动数量（正数=入库，负数=出库）',
  `inventory` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '关联单据ID',
  `operator` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '操作人',
  `created_at` datetime(3) DEFAULT NULL COMMENT '创建时间',
  `cumulative_quantity` decimal(10,2) DEFAULT NULL COMMENT '累计数量',
  `is_deleted` bigint DEFAULT '0' COMMENT '是否删除 1已删除,0未删除',
  PRIMARY KEY (`id`),
  KEY `idx_fc_stock_batch_log_stock_batch_id` (`stock_batch_id`),
  KEY `idx_fc_stock_batch_log_inventory` (`inventory`)
) ENGINE=InnoDB AUTO_INCREMENT=9613 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='库存日志表';

-- ----------------------------
-- Records of fc_stock_batch_log
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for fc_supplier
-- ----------------------------
DROP TABLE IF EXISTS `fc_supplier`;
CREATE TABLE `fc_supplier` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `created_at` datetime(3) DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime(3) DEFAULT NULL COMMENT '修改时间',
  `suid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '供应商ID',
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '供应商名称',
  `contact_person` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '联系人',
  `contact_phone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '联系电话',
  `address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '地址',
  `comment` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '备注',
  `has_factory_audit` int DEFAULT NULL COMMENT '是否验厂 1=未 2=已',
  `is_deleted` bigint DEFAULT '0' COMMENT '是否删除 1已删除,0未删除',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uni_fc_supplier_suid` (`suid`),
  KEY `idx_fc_supplier_suid` (`suid`)
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of fc_supplier
-- ----------------------------
BEGIN;
INSERT INTO `fc_supplier` (`id`, `created_at`, `updated_at`, `suid`, `name`, `contact_person`, `contact_phone`, `address`, `comment`, `has_factory_audit`, `is_deleted`) VALUES (20, '2025-07-17 11:12:51.827', '2025-07-17 11:12:51.827', 'su4e3834d8', '第一个供应商', '第一个供应商联系人', '18547658518', '', '', 0, 0);
COMMIT;

-- ----------------------------
-- Table structure for fc_template
-- ----------------------------
DROP TABLE IF EXISTS `fc_template`;
CREATE TABLE `fc_template` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime DEFAULT NULL COMMENT '修改时间',
  `tmid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '模板ID',
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '模板名称',
  `owner` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '模板创建者',
  `warehouse` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '仓库ID',
  `is_deleted` int DEFAULT '0' COMMENT '是否删除 1已删除,0未删除',
  PRIMARY KEY (`id`),
  KEY `idx_tmid` (`tmid`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='模板表';

-- ----------------------------
-- Records of fc_template
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for fc_template_detail
-- ----------------------------
DROP TABLE IF EXISTS `fc_template_detail`;
CREATE TABLE `fc_template_detail` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime DEFAULT NULL COMMENT '修改时间',
  `template` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '模板ID',
  `goods` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '货品ID',
  `amount` decimal(10,2) DEFAULT NULL COMMENT '数量',
  `is_deleted` int DEFAULT '0' COMMENT '是否删除 1已删除,0未删除',
  PRIMARY KEY (`id`),
  KEY `idx_template` (`template`)
) ENGINE=InnoDB AUTO_INCREMENT=39 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='模板明细表';

-- ----------------------------
-- Records of fc_template_detail
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for fc_transfer
-- ----------------------------
DROP TABLE IF EXISTS `fc_transfer`;
CREATE TABLE `fc_transfer` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `created_at` datetime(3) DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime(3) DEFAULT NULL COMMENT '修改时间',
  `tid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '单据ID',
  `number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '单据号',
  `date` datetime(3) DEFAULT NULL COMMENT '时间',
  `goods_list` json DEFAULT NULL COMMENT '货品JSON列表',
  `sour_warehouse` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '原仓库',
  `dest_warehouse` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '目标仓库',
  `out_iid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '出库记录iid',
  `in_iid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '入库记录iid',
  `operator` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '操作人',
  `comment` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '备注',
  `audited` tinyint(1) DEFAULT '0' COMMENT '是否审核',
  `passed` tinyint(1) DEFAULT '0' COMMENT '是否通过',
  `auditor` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '审核人',
  `audited_time` datetime(3) DEFAULT NULL COMMENT '审核时间',
  `audit_comment` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '审核备注',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uni_fc_transfer_tid` (`tid`),
  UNIQUE KEY `uni_fc_transfer_number` (`number`),
  KEY `idx_fc_transfer_tid` (`tid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='库存调拨表';

-- ----------------------------
-- Records of fc_transfer
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for fc_unit
-- ----------------------------
DROP TABLE IF EXISTS `fc_unit`;
CREATE TABLE `fc_unit` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `created_at` datetime(3) DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime(3) DEFAULT NULL COMMENT '修改时间',
  `unid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '计量单位ID',
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '计量单位名',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uni_fc_unit_unid` (`unid`),
  KEY `idx_fc_unit_unid` (`unid`)
) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='计量单位表';

-- ----------------------------
-- Records of fc_unit
-- ----------------------------
BEGIN;
INSERT INTO `fc_unit` (`id`, `created_at`, `updated_at`, `unid`, `name`) VALUES (1, '2025-03-05 22:53:48.877', '2025-03-05 22:53:48.877', 'un33cdccb9', '个');
INSERT INTO `fc_unit` (`id`, `created_at`, `updated_at`, `unid`, `name`) VALUES (26, '2025-07-10 21:47:22.589', '2025-07-10 21:47:22.589', '_default_', '未知');
COMMIT;

-- ----------------------------
-- Table structure for fc_user
-- ----------------------------
DROP TABLE IF EXISTS `fc_user`;
CREATE TABLE `fc_user` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `created_at` datetime(3) DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime(3) DEFAULT NULL COMMENT '修改时间',
  `uid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '用户ID',
  `account` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '账号',
  `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '密码',
  `permission` bigint DEFAULT NULL COMMENT '权限 1普通用户,2管理员,3超级管理员',
  `nickname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '昵称',
  `phone` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '手机号',
  `email` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '邮箱',
  `status` int DEFAULT '1' COMMENT '状态 1启用,2停用',
  `token` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '登陆Token',
  `session_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '登陆SessionID',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uni_fc_user_uid` (`uid`),
  KEY `idx_fc_user_uid` (`uid`)
) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='登陆用户表';

-- ----------------------------
-- Records of fc_user
-- ----------------------------
BEGIN;
INSERT INTO `fc_user` (`id`, `created_at`, `updated_at`, `uid`, `account`, `password`, `permission`, `nickname`, `phone`, `email`, `status`, `token`, `session_id`) VALUES (1, '2025-03-05 22:52:35.610', '2025-07-17 11:35:36.336', 'u00000001', 'admin', '123456', 3, 'admin', '', '', 1, '', '5420883b089b46519bb25765f515b81a');
INSERT INTO `fc_user` (`id`, `created_at`, `updated_at`, `uid`, `account`, `password`, `permission`, `nickname`, `phone`, `email`, `status`, `token`, `session_id`) VALUES (16, '2025-07-10 21:47:22.587', '2025-07-17 11:52:28.297', 'u00000002', 'super', '123456', 3, 'super', '', '', 1, '', 'aa3fca32acff473caca3570d4e9f53ae');
INSERT INTO `fc_user` (`id`, `created_at`, `updated_at`, `uid`, `account`, `password`, `permission`, `nickname`, `phone`, `email`, `status`, `token`, `session_id`) VALUES (17, '2025-07-10 21:47:22.588', '2025-07-10 21:47:22.588', 'u00000003', 'yang', '123456', 3, 'yang', '', '', 1, '', '');
COMMIT;

-- ----------------------------
-- Table structure for fc_verification_code
-- ----------------------------
DROP TABLE IF EXISTS `fc_verification_code`;
CREATE TABLE `fc_verification_code` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '邮箱,主键',
  `code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '验证码',
  `created_at` datetime(3) DEFAULT NULL COMMENT '创建时间',
  `used` tinyint(1) DEFAULT NULL COMMENT '验证码状态 1已使用,0未使用',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uni_fc_verification_code_email` (`email`),
  KEY `idx_fc_verification_code_email` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='验证码表';

-- ----------------------------
-- Records of fc_verification_code
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for fc_warehouse
-- ----------------------------
DROP TABLE IF EXISTS `fc_warehouse`;
CREATE TABLE `fc_warehouse` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `created_at` datetime(3) DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime(3) DEFAULT NULL COMMENT '修改时间',
  `wid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '仓库ID',
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '仓库名称',
  `location` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '仓库位置',
  `manager` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '管理人',
  `comment` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '备注',
  `status` bigint DEFAULT '1' COMMENT '状态 1启用,2禁用',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uni_fc_warehouse_wid` (`wid`),
  KEY `idx_fc_warehouse_wid` (`wid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='仓库表';

-- ----------------------------
-- Records of fc_warehouse
-- ----------------------------
BEGIN;
INSERT INTO `fc_warehouse` (`id`, `created_at`, `updated_at`, `wid`, `name`, `location`, `manager`, `comment`, `status`) VALUES (1, '2025-03-05 22:52:35.590', '2025-03-05 22:52:35.590', '_default_', '默认仓库', '', '_default_', '', 1);
COMMIT;

-- ----------------------------
-- Table structure for fc_wx_user
-- ----------------------------
DROP TABLE IF EXISTS `fc_wx_user`;
CREATE TABLE `fc_wx_user` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime DEFAULT NULL COMMENT '修改时间',
  `uid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '微信用户ID',
  `open_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '微信openid',
  `nickname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '昵称',
  `phone` varchar(155) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '手机号',
  `wx_uid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '原用户ID',
  `status` int DEFAULT '1' COMMENT '状态 1启用,2停用',
  `is_deleted` int DEFAULT '0' COMMENT '是否删除 1已删除,0未删除',
  PRIMARY KEY (`id`),
  KEY `idx_uid` (`uid`),
  KEY `idx_` (`wx_uid`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='微信用户表';

-- ----------------------------
-- Records of fc_wx_user
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for jwt_blacklists
-- ----------------------------
DROP TABLE IF EXISTS `jwt_blacklists`;
CREATE TABLE `jwt_blacklists` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `created_at` datetime(3) DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime(3) DEFAULT NULL COMMENT '更新时间',
  `deleted_at` datetime(3) DEFAULT NULL COMMENT '删除时间',
  `jwt` text COLLATE utf8mb4_general_ci NOT NULL COMMENT 'jwt token',
  PRIMARY KEY (`id`),
  KEY `idx_jwt_blacklists_deleted_at` (`deleted_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of jwt_blacklists
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for role_permissions
-- ----------------------------
DROP TABLE IF EXISTS `role_permissions`;
CREATE TABLE `role_permissions` (
  `permission_id` bigint unsigned NOT NULL COMMENT '主键ID',
  `role_id` bigint unsigned NOT NULL COMMENT '主键ID',
  PRIMARY KEY (`permission_id`,`role_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of role_permissions
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for sys_jwt_blacklists
-- ----------------------------
DROP TABLE IF EXISTS `sys_jwt_blacklists`;
CREATE TABLE `sys_jwt_blacklists` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `created_at` datetime(3) DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime(3) DEFAULT NULL COMMENT '更新时间',
  `deleted_at` datetime(3) DEFAULT NULL COMMENT '删除时间',
  `jwt` text COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'jwt token',
  PRIMARY KEY (`id`),
  KEY `idx_jwt_blacklists_deleted_at` (`deleted_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='JWT令牌黑名单表';

-- ----------------------------
-- Records of sys_jwt_blacklists
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for sys_permissions
-- ----------------------------
DROP TABLE IF EXISTS `sys_permissions`;
CREATE TABLE `sys_permissions` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `created_at` datetime(3) DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime(3) DEFAULT NULL COMMENT '更新时间',
  `deleted_at` datetime(3) DEFAULT NULL COMMENT '删除时间',
  `name` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '权限名称',
  `code` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '权限代码',
  `type` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '权限类型 menu菜单 button按钮 api接口',
  `path` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '路径',
  `method` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '请求方法',
  `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '权限描述',
  `parent_id` bigint unsigned DEFAULT '0' COMMENT '父级ID',
  `sort` int DEFAULT '0' COMMENT '排序',
  `status` int DEFAULT '1' COMMENT '状态 1正常 2禁用',
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_sys_permissions_code` (`code`),
  KEY `idx_permissions_deleted_at` (`deleted_at`),
  KEY `idx_sys_permissions_deleted_at` (`deleted_at`)
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='系统权限表';

-- ----------------------------
-- Records of sys_permissions
-- ----------------------------
BEGIN;
INSERT INTO `sys_permissions` (`id`, `created_at`, `updated_at`, `deleted_at`, `name`, `code`, `type`, `path`, `method`, `description`, `parent_id`, `sort`, `status`) VALUES (1, '2025-07-22 07:40:25.000', '2025-07-22 07:40:25.000', NULL, '用户管理', 'user_management', 'menu', '/user', '', '用户管理菜单', 0, 1, 1);
INSERT INTO `sys_permissions` (`id`, `created_at`, `updated_at`, `deleted_at`, `name`, `code`, `type`, `path`, `method`, `description`, `parent_id`, `sort`, `status`) VALUES (2, '2025-07-22 07:40:25.000', '2025-07-22 07:40:25.000', NULL, '用户列表', 'user_list', 'api', '/api/v1/user/list', 'GET', '获取用户列表', 1, 1, 1);
INSERT INTO `sys_permissions` (`id`, `created_at`, `updated_at`, `deleted_at`, `name`, `code`, `type`, `path`, `method`, `description`, `parent_id`, `sort`, `status`) VALUES (3, '2025-07-22 07:40:25.000', '2025-07-22 07:40:25.000', NULL, '用户详情', 'user_detail', 'api', '/api/v1/user/info', 'GET', '获取用户详情', 1, 2, 1);
INSERT INTO `sys_permissions` (`id`, `created_at`, `updated_at`, `deleted_at`, `name`, `code`, `type`, `path`, `method`, `description`, `parent_id`, `sort`, `status`) VALUES (4, '2025-07-22 07:40:25.000', '2025-07-22 07:40:25.000', NULL, '创建用户', 'user_create', 'api', '/api/v1/user/create', 'POST', '创建用户', 1, 3, 1);
INSERT INTO `sys_permissions` (`id`, `created_at`, `updated_at`, `deleted_at`, `name`, `code`, `type`, `path`, `method`, `description`, `parent_id`, `sort`, `status`) VALUES (5, '2025-07-22 07:40:25.000', '2025-07-22 07:40:25.000', NULL, '更新用户', 'user_update', 'api', '/api/v1/user/update', 'PUT', '更新用户信息', 1, 4, 1);
INSERT INTO `sys_permissions` (`id`, `created_at`, `updated_at`, `deleted_at`, `name`, `code`, `type`, `path`, `method`, `description`, `parent_id`, `sort`, `status`) VALUES (6, '2025-07-22 07:40:25.000', '2025-07-22 07:40:25.000', NULL, '删除用户', 'user_delete', 'api', '/api/v1/user/delete', 'DELETE', '删除用户', 1, 5, 1);
INSERT INTO `sys_permissions` (`id`, `created_at`, `updated_at`, `deleted_at`, `name`, `code`, `type`, `path`, `method`, `description`, `parent_id`, `sort`, `status`) VALUES (7, '2025-07-22 07:40:25.000', '2025-07-22 07:40:25.000', NULL, '角色管理', 'role_management', 'menu', '/role', '', '角色管理菜单', 0, 2, 1);
INSERT INTO `sys_permissions` (`id`, `created_at`, `updated_at`, `deleted_at`, `name`, `code`, `type`, `path`, `method`, `description`, `parent_id`, `sort`, `status`) VALUES (8, '2025-07-22 07:40:25.000', '2025-07-22 07:40:25.000', NULL, '角色列表', 'role_list', 'api', '/api/v1/role/list', 'GET', '获取角色列表', 7, 1, 1);
INSERT INTO `sys_permissions` (`id`, `created_at`, `updated_at`, `deleted_at`, `name`, `code`, `type`, `path`, `method`, `description`, `parent_id`, `sort`, `status`) VALUES (9, '2025-07-22 07:40:25.000', '2025-07-22 07:40:25.000', NULL, '角色详情', 'role_detail', 'api', '/api/v1/role/info', 'GET', '获取角色详情', 7, 2, 1);
INSERT INTO `sys_permissions` (`id`, `created_at`, `updated_at`, `deleted_at`, `name`, `code`, `type`, `path`, `method`, `description`, `parent_id`, `sort`, `status`) VALUES (10, '2025-07-22 07:40:25.000', '2025-07-22 07:40:25.000', NULL, '创建角色', 'role_create', 'api', '/api/v1/role/create', 'POST', '创建角色', 7, 3, 1);
INSERT INTO `sys_permissions` (`id`, `created_at`, `updated_at`, `deleted_at`, `name`, `code`, `type`, `path`, `method`, `description`, `parent_id`, `sort`, `status`) VALUES (11, '2025-07-22 07:40:25.000', '2025-07-22 07:40:25.000', NULL, '更新角色', 'role_update', 'api', '/api/v1/role/update', 'PUT', '更新角色信息', 7, 4, 1);
INSERT INTO `sys_permissions` (`id`, `created_at`, `updated_at`, `deleted_at`, `name`, `code`, `type`, `path`, `method`, `description`, `parent_id`, `sort`, `status`) VALUES (12, '2025-07-22 07:40:25.000', '2025-07-22 07:40:25.000', NULL, '删除角色', 'role_delete', 'api', '/api/v1/role/delete', 'DELETE', '删除角色', 7, 5, 1);
INSERT INTO `sys_permissions` (`id`, `created_at`, `updated_at`, `deleted_at`, `name`, `code`, `type`, `path`, `method`, `description`, `parent_id`, `sort`, `status`) VALUES (13, '2025-07-22 07:40:25.000', '2025-07-22 07:40:25.000', NULL, '权限管理', 'permission_management', 'menu', '/permission', '', '权限管理菜单', 0, 3, 1);
INSERT INTO `sys_permissions` (`id`, `created_at`, `updated_at`, `deleted_at`, `name`, `code`, `type`, `path`, `method`, `description`, `parent_id`, `sort`, `status`) VALUES (14, '2025-07-22 07:40:25.000', '2025-07-22 07:40:25.000', NULL, '权限列表', 'permission_list', 'api', '/api/v1/permission/list', 'GET', '获取权限列表', 13, 1, 1);
INSERT INTO `sys_permissions` (`id`, `created_at`, `updated_at`, `deleted_at`, `name`, `code`, `type`, `path`, `method`, `description`, `parent_id`, `sort`, `status`) VALUES (15, '2025-07-22 07:40:25.000', '2025-07-22 07:40:25.000', NULL, '权限详情', 'permission_detail', 'api', '/api/v1/permission/info', 'GET', '获取权限详情', 13, 2, 1);
INSERT INTO `sys_permissions` (`id`, `created_at`, `updated_at`, `deleted_at`, `name`, `code`, `type`, `path`, `method`, `description`, `parent_id`, `sort`, `status`) VALUES (16, '2025-07-22 07:40:25.000', '2025-07-22 07:40:25.000', NULL, '创建权限', 'permission_create', 'api', '/api/v1/permission/create', 'POST', '创建权限', 13, 3, 1);
INSERT INTO `sys_permissions` (`id`, `created_at`, `updated_at`, `deleted_at`, `name`, `code`, `type`, `path`, `method`, `description`, `parent_id`, `sort`, `status`) VALUES (17, '2025-07-22 07:40:25.000', '2025-07-22 07:40:25.000', NULL, '更新权限', 'permission_update', 'api', '/api/v1/permission/update', 'PUT', '更新权限信息', 13, 4, 1);
INSERT INTO `sys_permissions` (`id`, `created_at`, `updated_at`, `deleted_at`, `name`, `code`, `type`, `path`, `method`, `description`, `parent_id`, `sort`, `status`) VALUES (18, '2025-07-22 07:40:25.000', '2025-07-22 07:40:25.000', NULL, '删除权限', 'permission_delete', 'api', '/api/v1/permission/delete', 'DELETE', '删除权限', 13, 5, 1);
COMMIT;

-- ----------------------------
-- Table structure for sys_role_permissions
-- ----------------------------
DROP TABLE IF EXISTS `sys_role_permissions`;
CREATE TABLE `sys_role_permissions` (
  `role_id` bigint unsigned NOT NULL COMMENT '角色ID',
  `permission_id` bigint unsigned NOT NULL COMMENT '权限ID',
  PRIMARY KEY (`role_id`,`permission_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='角色-权限关联表';

-- ----------------------------
-- Records of sys_role_permissions
-- ----------------------------
BEGIN;
INSERT INTO `sys_role_permissions` (`role_id`, `permission_id`) VALUES (1, 1);
INSERT INTO `sys_role_permissions` (`role_id`, `permission_id`) VALUES (1, 2);
INSERT INTO `sys_role_permissions` (`role_id`, `permission_id`) VALUES (1, 3);
INSERT INTO `sys_role_permissions` (`role_id`, `permission_id`) VALUES (1, 4);
INSERT INTO `sys_role_permissions` (`role_id`, `permission_id`) VALUES (1, 5);
INSERT INTO `sys_role_permissions` (`role_id`, `permission_id`) VALUES (1, 6);
INSERT INTO `sys_role_permissions` (`role_id`, `permission_id`) VALUES (1, 7);
INSERT INTO `sys_role_permissions` (`role_id`, `permission_id`) VALUES (1, 8);
INSERT INTO `sys_role_permissions` (`role_id`, `permission_id`) VALUES (1, 9);
INSERT INTO `sys_role_permissions` (`role_id`, `permission_id`) VALUES (1, 10);
INSERT INTO `sys_role_permissions` (`role_id`, `permission_id`) VALUES (1, 11);
INSERT INTO `sys_role_permissions` (`role_id`, `permission_id`) VALUES (1, 12);
INSERT INTO `sys_role_permissions` (`role_id`, `permission_id`) VALUES (1, 13);
INSERT INTO `sys_role_permissions` (`role_id`, `permission_id`) VALUES (1, 14);
INSERT INTO `sys_role_permissions` (`role_id`, `permission_id`) VALUES (1, 15);
INSERT INTO `sys_role_permissions` (`role_id`, `permission_id`) VALUES (1, 16);
INSERT INTO `sys_role_permissions` (`role_id`, `permission_id`) VALUES (1, 17);
INSERT INTO `sys_role_permissions` (`role_id`, `permission_id`) VALUES (1, 18);
INSERT INTO `sys_role_permissions` (`role_id`, `permission_id`) VALUES (2, 1);
INSERT INTO `sys_role_permissions` (`role_id`, `permission_id`) VALUES (2, 2);
INSERT INTO `sys_role_permissions` (`role_id`, `permission_id`) VALUES (2, 3);
INSERT INTO `sys_role_permissions` (`role_id`, `permission_id`) VALUES (2, 4);
INSERT INTO `sys_role_permissions` (`role_id`, `permission_id`) VALUES (2, 5);
INSERT INTO `sys_role_permissions` (`role_id`, `permission_id`) VALUES (2, 7);
INSERT INTO `sys_role_permissions` (`role_id`, `permission_id`) VALUES (2, 8);
INSERT INTO `sys_role_permissions` (`role_id`, `permission_id`) VALUES (2, 9);
INSERT INTO `sys_role_permissions` (`role_id`, `permission_id`) VALUES (2, 10);
INSERT INTO `sys_role_permissions` (`role_id`, `permission_id`) VALUES (2, 11);
INSERT INTO `sys_role_permissions` (`role_id`, `permission_id`) VALUES (2, 13);
INSERT INTO `sys_role_permissions` (`role_id`, `permission_id`) VALUES (2, 14);
INSERT INTO `sys_role_permissions` (`role_id`, `permission_id`) VALUES (2, 15);
INSERT INTO `sys_role_permissions` (`role_id`, `permission_id`) VALUES (2, 16);
INSERT INTO `sys_role_permissions` (`role_id`, `permission_id`) VALUES (2, 17);
INSERT INTO `sys_role_permissions` (`role_id`, `permission_id`) VALUES (3, 3);
COMMIT;

-- ----------------------------
-- Table structure for sys_roles
-- ----------------------------
DROP TABLE IF EXISTS `sys_roles`;
CREATE TABLE `sys_roles` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `created_at` datetime(3) DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime(3) DEFAULT NULL COMMENT '更新时间',
  `deleted_at` datetime(3) DEFAULT NULL COMMENT '删除时间',
  `name` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '角色名称',
  `code` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '角色代码',
  `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '角色描述',
  `status` int DEFAULT '1' COMMENT '状态 1正常 2禁用',
  `sort` int DEFAULT '0' COMMENT '排序',
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_sys_roles_name` (`name`),
  UNIQUE KEY `idx_sys_roles_code` (`code`),
  KEY `idx_roles_deleted_at` (`deleted_at`),
  KEY `idx_sys_roles_deleted_at` (`deleted_at`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='系统角色表';

-- ----------------------------
-- Records of sys_roles
-- ----------------------------
BEGIN;
INSERT INTO `sys_roles` (`id`, `created_at`, `updated_at`, `deleted_at`, `name`, `code`, `description`, `status`, `sort`) VALUES (1, '2025-07-22 07:40:25.000', '2025-07-22 07:40:25.000', NULL, '超级管理员', 'super_admin', '系统超级管理员，拥有所有权限', 1, 1);
INSERT INTO `sys_roles` (`id`, `created_at`, `updated_at`, `deleted_at`, `name`, `code`, `description`, `status`, `sort`) VALUES (2, '2025-07-22 07:40:25.000', '2025-07-22 07:40:25.000', NULL, '管理员', 'admin', '系统管理员', 1, 2);
INSERT INTO `sys_roles` (`id`, `created_at`, `updated_at`, `deleted_at`, `name`, `code`, `description`, `status`, `sort`) VALUES (3, '2025-07-22 07:40:25.000', '2025-07-22 07:40:25.000', NULL, '普通用户', 'user', '普通用户', 1, 3);
COMMIT;

-- ----------------------------
-- Table structure for sys_user_roles
-- ----------------------------
DROP TABLE IF EXISTS `sys_user_roles`;
CREATE TABLE `sys_user_roles` (
  `user_id` bigint unsigned NOT NULL COMMENT '用户ID',
  `role_id` bigint unsigned NOT NULL COMMENT '角色ID',
  PRIMARY KEY (`user_id`,`role_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='用户-角色关联表';

-- ----------------------------
-- Records of sys_user_roles
-- ----------------------------
BEGIN;
INSERT INTO `sys_user_roles` (`user_id`, `role_id`) VALUES (1, 1);
COMMIT;

-- ----------------------------
-- Table structure for sys_users
-- ----------------------------
DROP TABLE IF EXISTS `sys_users`;
CREATE TABLE `sys_users` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `created_at` datetime(3) DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime(3) DEFAULT NULL COMMENT '更新时间',
  `deleted_at` datetime(3) DEFAULT NULL COMMENT '删除时间',
  `username` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '用户名',
  `password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '密码',
  `email` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '邮箱',
  `phone` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '手机号',
  `avatar` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '头像',
  `nickname` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '昵称',
  `status` int DEFAULT '1' COMMENT '状态 1正常 2禁用',
  `last_login_at` datetime(3) DEFAULT NULL COMMENT '最后登录时间',
  `last_login_ip` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '最后登录IP',
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_sys_users_username` (`username`),
  UNIQUE KEY `idx_sys_users_email` (`email`),
  KEY `idx_users_deleted_at` (`deleted_at`),
  KEY `idx_sys_users_deleted_at` (`deleted_at`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='系统用户表';

-- ----------------------------
-- Records of sys_users
-- ----------------------------
BEGIN;
INSERT INTO `sys_users` (`id`, `created_at`, `updated_at`, `deleted_at`, `username`, `password`, `email`, `phone`, `avatar`, `nickname`, `status`, `last_login_at`, `last_login_ip`) VALUES (1, '2025-07-22 07:40:25.000', '2025-07-25 16:08:39.842', NULL, 'admin', '$2a$10$UqgZeU.Mm//SG5kJUn/xO./g/NdsYz6Abt5BZNeiF4gjGBbu0UI92', 'admin@example.com', '', '', '管理员', 1, '2025-07-25 16:08:39.840', '');
INSERT INTO `sys_users` (`id`, `created_at`, `updated_at`, `deleted_at`, `username`, `password`, `email`, `phone`, `avatar`, `nickname`, `status`, `last_login_at`, `last_login_ip`) VALUES (2, '2025-07-22 16:57:23.701', '2025-07-22 16:58:16.002', NULL, 'testuser', '$2a$10$zkKSp/x0xJKQ3CF6PUBgQ.FM8o11qIqfPT4YkdH2yLgoGeqasBO1q', 'test@example.com', '', '', '测试用户', 1, '2025-07-22 16:58:16.001', '');
INSERT INTO `sys_users` (`id`, `created_at`, `updated_at`, `deleted_at`, `username`, `password`, `email`, `phone`, `avatar`, `nickname`, `status`, `last_login_at`, `last_login_ip`) VALUES (3, '2025-07-25 16:01:20.059', '2025-07-25 16:01:20.059', NULL, 'testuser1', '$2a$10$UqgZeU.Mm//SG5kJUn/xO./g/NdsYz6Abt5BZNeiF4gjGBbu0UI92', 'tes1@example.com', '', '', '测试用户', 1, NULL, '');
COMMIT;

-- ----------------------------
-- Table structure for user_roles
-- ----------------------------
DROP TABLE IF EXISTS `user_roles`;
CREATE TABLE `user_roles` (
  `role_id` bigint unsigned NOT NULL COMMENT '主键ID',
  `user_id` bigint unsigned NOT NULL COMMENT '主键ID',
  PRIMARY KEY (`role_id`,`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of user_roles
-- ----------------------------
BEGIN;
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
